


/*------------------------------------------------------------------------------

						TABLE 1 PANEL A
						
------------------------------------------------------------------------------*/


use "output/DA", clear

* account value
gen P = PM_clo_ig/1e6*euro2015 // convert in bn 2015 euro
label var P "Account value (bn euro)"

* flows
gen Pa_ig = PM_ouv_ig + (Inflow_ig-Outflow_ig)/2
gen inflow_ig = Inflow_ig/Pa_ig*100
gen outflow_ig = Outflow_ig/Pa_ig*100
gen redemp_ig = Redemp_ig/Pa_ig*100
label var inflow_ig "Inflows (\% account value)"
label var outflow_ig "Outflows (\% account value)"
label var redemp_ig "Redemptions (\% account value)"

* returns
gen y = Revalo_ig/Pa_ig*100
gen x = Retass_ig/(Pa_ig+Reserve_ig_lag)*100
label var x "Asset return (\%)"
label var y "Contract return (\%)"

* asset portfolio
local asset re stock bond cash loan
foreach x in `asset' {
gen share_`x' = Asset_`x'_mrkt/Asstot_mrkt*100
}
label var share_bond "Portfolio share: bonds (\%)"
label var share_stock "Portfolio share: stocks (\%)"

* drop if missing lagged or jump in provisions > 5%
drop if year==1999
drop if Retass_ig==.
drop if Reserve_ig_lag==.
drop if abs(alpha_ig-1)>.05 & alpha_ig<.

* drop if singleton
egen n = count(year), by(matricule)
drop if n==1
drop n

* reserves
foreach x in Reserve_ig Reserve_PPB_ig Reserve_RC_ig Reserve_unrealized {
local y = lower("`x'")
gen `y' = `x'/PM_clo_ig*100
}
label var reserve_ig "Reserves (\% account value)"
label var reserve_ppb_ig "\quad Profit-sharing reserves (\% account value)"
label var reserve_rc_ig "\quad Capitalization reserves (\% account value)"
label var reserve_unrealized "\quad Unrealized gains (\% account value)"

* 76 insurers
distinct matricule

* summary stats (value weighted)
eststo clear
capture drop w
egen w = sum(P), by(year)
replace w = P/w
estpost tabstat inflow_ig outflow_ig reserve_ig share_bond share_stock x y [aw=w], stat(mean sd p25 p50 p75 count) col(stat)
estout using "$results/sum-stat-da.tex", replace style(tex) cells("mean(fmt(%12.1f) label(Mean)) sd(fmt(%12.1f) label(S.D.)) p25(fmt(%12.1f) label(P25)) p50(fmt(%12.1f) label(P50)) p75(fmt(%12.1f) label(P75)) count(fmt(%12.0fc) label(N))") label mlabels(none) collabels(none) varwidth(50)




/*------------------------------------------------------------------------------

					FIGURES 1 & 2: SMOOTHING
						
------------------------------------------------------------------------------*/

use "$output/DA", clear


*** FIGURE 1

* same cleaning as above

gen Pa_ig = PM_ouv_ig + (Inflow_ig-Outflow_ig)/2
drop if Retass_ig==. | Reserve_ig_lag==. | (abs(alpha_ig-1)>.05 & alpha_ig<.)
sum Pa_ig Retass_ig Revalo_ig Reserve_ig Reserve_ig_lag

* collapse at year level

collapse (sum) Pa_ig Retass_ig Revalo_ig Reserve_ig Reserve_ig_lag, by(year)
gen y = Revalo_ig/Pa_ig
gen x = Retass_ig/(Pa_ig+Reserve_ig_lag)
label var y "Contract return"
label var x "Asset return"

* plot series

line y x year, legend(on) lpattern(solid dash) ylabel(, angle(horizontal)) xlabel(2000(3)2015) ylabel(-.04(.02).14) xtitle("") ytitle("") graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))

graph export "$results/return.pdf", as(pdf) replace


*** FIGURE 2

* decomposition of transfer

gen transfer = (Revalo_ig-Retass_ig)/Pa_ig
gen transfer_res = -(Reserve_ig-Reserve_ig_lag)/Pa_ig
label var transfer "Contract return - Asset return"
label var transfer_res "Minus change in fund reserves"

* plot series (figure 2)

line transfer transfer_res year, lpattern(solid dash) legend(cols(1)) ylabel(, angle(horizontal)) xlabel(2000(3)2015) xtitle("") ytitle("") graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))

graph export "$results/transfer.pdf", as(pdf) replace




/*------------------------------------------------------------------------------

					FIGURE B1: AGGREGATE ACCOUNT VALUE
						
------------------------------------------------------------------------------*/

use "$output/DA", clear

gen n = 1
collapse (sum) PM_clo=PM_clo_ig n (mean) euro2015, by(year)

* convert into 2015 bn euros
foreach x in PM_clo {
replace `x' = `x'/1e6*euro2015
}

label var PM_clo "Aggregate account value (left scale, bn euro)"
label var n "Number of insurers (right scale)"

tw (line PM_clo year if year>=2000, legend(cols(1)) yaxis(1) xtitle("") ytitle("",axis(1)) ylabel(,angle(horizontal)axis(1)) xlabel(2000(3)2015) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))) ///
	(line n year if year>=2000, yaxis(2) lpattern(dash) ytitle("",axis(2)) ylabel(,angle(horizontal)axis(2)) ylabel(50(10)80,axis(2)))

graph export "$results/aggregate-provisions.pdf", as(pdf) replace





/*------------------------------------------------------------------------------

					FIGURE B2: AGGREGATE RESERVES
						
------------------------------------------------------------------------------*/

use "$output/DA", clear

* collapse at year level

keep if Reserve_ig<.
collapse (sum) Reserve_ig Reserve_PPB_ig Reserve_RC_ig Reserve_unrealized PM_clo_ig, by(year)

* reserves as % of account value

foreach x in Reserve_ig Reserve_PPB_ig Reserve_RC_ig Reserve_unrealized {
local y = lower("`x'")
gen `y' = `x'/PM_clo
}

label var reserve_ig "Total reserves"
label var reserve_ppb_ig "Profit-sharing reserves"
label var reserve_rc_ig "Capitalization reserves"
label var reserve_unrealized "Unrealized gains"

* plot series

line reserve_ig reserve_unrealized reserve_ppb_ig reserve_rc_ig year if year>=2000, lwidth(medium medthin medthin medthin) lpattern(solid longdash dash shortdash) legend(cols(2)) ylabel(, angle(horizontal)) xlabel(2000(3)2015) xtitle("") ytitle("") graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))

graph export "$results/aggregate-reserves.pdf", as(pdf) replace




/*------------------------------------------------------------------------------

					FIGURE B3: REGULATORY CAPITAL
						
------------------------------------------------------------------------------*/

use "$output/DA", clear

* regulatory capital is properly populated starting in 2004

keep if year>=2004

* create weight 

capture drop w
gen Pa_ig = PM_ouv_ig + (Inflow_ig-Outflow_ig)/2
egen w = sum(Pa_ig), by(year)
replace w = Pa_ig/w

* equity ratio

gen equityPM = marge_A/Pa_ig

* collapse at year level

gcollapse (mean) av_equityPM = equityPM [w=w], by(year)

* plot series

tw (line av_equityPM year if year>=2006, lcolor(black)) || ///
(function y = 0.04, range(2006 2015) lcolor(black) lpattern(dash)), ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) ///
legend(cols(1) label(1 "Ratio of equity to total account value") label(2 "Capital plus unrealized gains requirement")) ylabel(.035(.005).06,angle(horizontal) format(%5.4g)) xlabel(2006(1)2015)

graph export "$results/equity.pdf", as(pdf) replace


